package domain;

import java.util.HashMap;
import java.util.Map;

public enum SquareType{
	EMPTY('0'),
	OBSTACLE('1'),
	ENEMY('s'),
	DEFENDED('g'),
	TOWER('t');
	
	private char value;
	
	private SquareType(char value){
		this.value = value;
	}
	public char getValue(){
		return value;
	}
	
	private static Map<Character,SquareType> map = new HashMap<Character,SquareType>();
	static{
		for(SquareType type:SquareType.values()){
			map.put(type.getValue(), type);
		}
	}
	
	public static SquareType toSquareType(char value){
		return map.get(value);
	}
	
}
